package com.hzc.springchan.strategy.paramcheck.impl;

import com.hzc.springchan.bean.request.Request;
import com.hzc.springchan.constant.System;
import com.hzc.springchan.strategy.paramcheck.IParamCheckStrategy;
import org.springframework.stereotype.Service;

/**
 * 参数非空校验
 * @author chen990627
 * @date 2022/10/18
 */
@Service(System.ParamCheck.NULL_CHECK)
public class ParamNullCheckStrategy implements IParamCheckStrategy {

    @Override
    public boolean paramCheck(Request request, String[] params) {

        for (String param : params) {
            if(request.get(param) == null) {
                return false;
            }
        }
        return true;
    }
}
